<%@ Page Language="VB" Theme="Default" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="MembershipManager.aspx.vb" Inherits="Secure_WebAdmin_MembershipManager" Title="Membership Manager" %>
<%@ Register Assembly="DotNetPM.Web.UI.WebControls" TagPrefix="cc" Namespace="DotNetPM.Web.UI.WebControls" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <div>
        <table id="Table1" border="0" cellpadding="2" cellspacing="2" width="100%">
            <tr>
                <td colspan="4">
                    <strong><font size="2">MEMBERSHIP MANAGER</font></strong></td>
                <td colspan="1">
                </td>
                <td align="right" colspan="1">
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Default.aspx" ForeColor="Blue">Back</asp:HyperLink></td>
            </tr>
            <tr>
                <td colspan="6">
                    <hr size="1" width="100%" />
                </td>
            </tr>
            <tr>
                <td rowspan="5" valign="top" width="15">
                </td>
                <td rowspan="1" colspan=5 valign="top" >
            <asp:DropDownList ID="ddlSearchField" runat="server">
                <asp:ListItem>UserName</asp:ListItem>
                <asp:ListItem Value="Email">Email Address</asp:ListItem>
            </asp:DropDownList>
            <asp:TextBox ID="txtSearchValue" runat="server"></asp:TextBox>
            <asp:Button ID="butSearch" runat="server" Text="Search" Width="60px" /></td>
            </tr>
            <tr>
                <td colspan="1" rowspan="1" valign="top">
            <asp:CheckBox ID="cbApproved" runat="server" AutoPostBack="True" Checked="True" Text="Show Approved Users" /></td>
                <td colspan="1" rowspan="1" valign="top">
            <asp:CheckBox ID="cbOnline" runat="server" AutoPostBack="True" Checked="True"
                Text="Show Online Users" /></td>
                <td rowspan="1" valign="top">
            <asp:CheckBox ID="cbLockedOut" runat="server" AutoPostBack="True" Checked="True"
                Text="Show Locked Out Users" /></td>
                <td rowspan="1" valign="top">
                </td>
                <td rowspan="1" valign="top">
                </td>
            </tr>
            <tr>
                <td colspan="1" rowspan="1" valign="top">
            <asp:CheckBox ID="cbNotApproved" runat="server" AutoPostBack="True" Checked="True"
                Text="Show Not Approved Users" /></td>
                <td colspan="1" rowspan="1" valign="top">
            <asp:CheckBox ID="cbNotOnline" runat="server" AutoPostBack="True" Checked="True"
                Text="Show Not Online Users" /></td>
                <td rowspan="1" valign="top">
            <asp:CheckBox ID="cbNotLockedOut" runat="server" AutoPostBack="True" Checked="True"
                Text="Show Not Locked Out Users" /></td>
                <td rowspan="1" valign="top" width="100">
                </td>
                <td rowspan="1" valign="top">
                </td>
            </tr>
            <tr>
                <td colspan="4" rowspan="1" valign="top" height="300">
            <asp:GridView ID="dgMembers" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" DataKeyNames="UserName"
                DataSourceID="odsMembership" Width="820px">
                <Columns>
                    <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName" />
                    <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                    <asp:CheckBoxField DataField="IsApproved" HeaderText="IsApproved" SortExpression="IsApproved" >
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:CheckBoxField>
                    <asp:CheckBoxField DataField="IsOnline" HeaderText="IsOnline" ReadOnly="True" SortExpression="IsOnline" >
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:CheckBoxField>
                    <asp:CheckBoxField DataField="IsLockedOut" HeaderText="IsLockedOut" ReadOnly="True"
                        SortExpression="IsLockedOut" >
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                    </asp:CheckBoxField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <cc:DynImageButton ID="dibDetail" runat="server" CausesValidation="false" CommandName="MembershipDetail"
                                CommandArgument='<%# Bind("UserName") %>' Text="Detail" ImageUrl="~/images/Detail_0.gif" ToolTip="Membership Detail" />
                        </ItemTemplate>
                        <ItemStyle Width="10px" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
                <asp:ObjectDataSource ID="odsMembership" runat="server" SelectMethod="GetMembers"
                SortParameterName="FieldToSort" TypeName="DotNetPM.Business.MembershipsAndRoles.MembershipODS">
                <SelectParameters>
                    <asp:ControlParameter ControlID="cbApproved" Name="returnAllApprovedUsers" PropertyName="Checked"
                        Type="Boolean" />
                    <asp:ControlParameter ControlID="cbNotApproved" Name="returnAllNotApprovedUsers"
                        PropertyName="Checked" Type="Boolean" />
                    <asp:ControlParameter ControlID="cbOnline" Name="returnAllOnlineUsers" PropertyName="Checked"
                        Type="Boolean" />
                    <asp:ControlParameter ControlID="cbNotOnline" Name="returnAllNotOnlineUsers" PropertyName="Checked"
                        Type="Boolean" />
                    <asp:ControlParameter ControlID="cbLockedOut" Name="returnAllLockedOutUsers" PropertyName="Checked"
                        Type="Boolean" />
                    <asp:ControlParameter ControlID="cbNotLockedOut" Name="returnAllNotLockedOutUsers"
                        PropertyName="Checked" Type="Boolean" />
                    <asp:ControlParameter ControlID="txtSearchValue" Name="StringToSearch" PropertyName="Text"
                        Type="String" />
                    <asp:ControlParameter ControlID="ddlSearchField" Name="FieldToSearch" PropertyName="SelectedValue"
                        Type="String" />
                    <asp:Parameter Name="FieldToSort" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
                </td>
                <td colspan="1" height="300" rowspan="1" valign="top">
                </td>
            </tr>
        </table>    
    </div>
</asp:Content>
